import requests
from config import url, headers_web


class CourseManagement:
    def __init__(self):
        self.url = url
        self.headers = headers_web

    @classmethod
    def get_course_primary_structure(cls, url: str, params=None, pathparams=None, headers=headers_web):
        """
        @Summary:接口-查看课程下一级结构
        @Description:云课堂老师端教学内容使用
        :param url:
        :param params:{
                        "validCode":"", # courseId=?&signKey=123123(md5加密)
                        "versionId":"" # 版本id
                        }
        :param pathparams:courseId:课程id
        :param headers:默认请求头
        :return:{
                    "showOrder":"", # 排序字段
                    "structureId":"", # 课程结构id
                    "structureName":"" # 课程结构名称
                    }
        """
        url = url + f"/courseApi/v1/coursemanagement/{pathparams}/primarystructure"
        r = requests.get(url=url, params=params, headers=headers)

        return r

    @classmethod
    def post_add_course(cls, url: str, params=None, json=None, headers=headers_web):
        """
        @Summary:接口-老师新增课程
        @Description:云课堂老师端课程管理使用
        :param url:
        :param params:validCode:&signKey=123123(md5加密)
        :param json:{
            "collegeName": "",#学院名称
            "courseName": "",#课程名称
            "teacherId": "",#老师id
            "teacherName": "",#老师姓名
            "teachingUserType": "",#授课对象
            "collegeId": "",#学院Id
            "courseCategoryId": "",#课程类别id
            "collegeCode": "",#学院编号
            "classHours": 0,#学时
            "teacherNo": "",#老师工号
            "courseContent": ""#课程内容
        }
        :param headers:Content-Type:application/json
        :return: 200 ok
        """
        url = url + "/courseApi/v1/coursemanagement/course"

        r = requests.post(url=url, headers=headers, params=params, json=json)

        return r

    @classmethod
    def get_course_resources(cls, url: str, params=None, headers=headers_web):
        """
        @Summary:接口-获取课程下结构及资源
        @Description:云课堂老师端新增学习材料使用
        :param url:/courseApi/v1/coursemanagement/courseresource
        :param params:{
            "courseId":"",# 课程id
            "userId":"",# 用户Id
            "validCode":"", # &signKey=123123(md5加密)
            "versionId":"" #版本id
        }
        :param headers:
        :return: object:{
                            "childStructureList":"",# 子课程结构
                            "courseResourceList":"",# 资源集合
                            "parentId":"",# 父id
                            "showOrder":"", # 排序字段
                            "structureId":"",# 课程结构id
                            "structureName	":"", # 课程结构名称
                            }
        """
        url = url + "/courseApi/v1/coursemanagement/courseresource"

        r = requests.post(url=url, params=params, headers=headers)

        return r

    @classmethod
    def post_admin_del_course(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:接口-管理员直接删除课程资源
        @Description:云课堂 管理端 教学素材管理-课程素材 使用
        :param url:/courseApi/v1/coursemanagement/courseresource/admin/delete
        :param params:{
                        "courseId":"",# 课程Id
                        "courseResourceIds":"",资源Id,多个以‘，’分割
                        "userId":"",# 用户Id
                        "validCode":"" # 验证码：&signKey=123123(md5加密)
                    }
        :param headers:
        :param json:body=None
        :return: 200 ok
        """

        url = url + "/courseApi/v1/coursemanagement/courseresource/admin/delete"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def post_teacher_del_course(cls, url: str, params=None, headers=headers_web, json=None):
        """
          @Summary:接口-删除课程资源
          @Description:云课堂老师端课程管理使用
          :param url:/courseApi/v1/coursemanagement/courseresource/delete
          :param params:{
                          "courseId":"",# 课程Id
                          "courseResourceIds":"",资源Id,多个以‘，’分割
                          "userId":"",# 用户Id
                          "validCode":"", # 验证码：&signKey=123123(md5加密)
                          "versionId":"" # 版本id
                      }
          :param headers:
          :param json:body=None
          :return: 200 ok
          """

        url = url + "/courseApi/v1/coursemanagement/courseresource/delete"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def get_course_content_detail(cls, url: str, params=None, headers=headers_web):
        """
        @Summary:接口-查看课程教学内容详情
        @Description:云课堂老师端课程管理使用
        :param url:
        :param params:{
                          "courseId":"",# 课程Id
                          "needFilterUserId":"",# 需要过滤的用户ID，即用户ID创建的资源不展示
                          "type":"",# （0-全部 1-只显示课程结构）
                          "validCode":"", # 验证码：&signKey=123123(md5加密)
                          "versionId":"" # 版本id
                      }
        :param headers:
        :return: object:{
                            "childStructureList":"",# 子课程结构
                            "courseResourceList":"",# 资源集合
                            "parentId":"",# 父id
                            "showOrder":"", # 排序字段
                            "structureId":"",# 课程结构id
                            "structureName	":"", # 课程结构名称
                            }
        """
        url = url + "/courseApi/v1/coursemanagement/coursescontent"

        r = requests.get(url=url, params=params, headers=headers)
        return r

    @classmethod
    def post_build_course_structure(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:接口-查看课程教学内容详情
        @Description:云课堂老师端课程管理使用
        :param url: /courseApi/v1/coursemanagement/coursestructure
        :param params:validCode:验证码：&signKey=123123(md5加密)
        :param headers:
        :param json:{
                        "courseId":"",# 课程id
                        "parentId":"",# 父节点id
                        "structureName":"",# 课程结构名称
                        "userId":"",# 用户id
                        "userName":"",# 用户名称
                        "versionId":""# 版本id
                        }
        :return:200 OK
        """
        url = url + "/courseApi/v1/coursemanagement/coursestructure"
        r = requests.post(url=url, params=params, headers=headers, json=json)
        return r

    @classmethod
    def post_del_course_structure(cls, url: str, params=None, headers=headers_web, json=None, paramspath=None):
        """
        @Summary:接口-删除课程结构
        @Description:云课堂老师端课程管理使用
        :param url:
        :param params:{
                        "userId":"", # 用户Id
                        "userName":"", # 用户名称
                        "validCode":"" # 验证码：id=?&signKey=123123(md5加密)
                        }
        :param headers:
        :param json:
        :param paramspath:id:课程结构id
        :return: 200 OK
        """

        url = url + f"/courseApi/v1/coursemanagement/coursestructure/{paramspath}"

        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def post_rename_course_structure(cls, url: str, params=None, headers=headers_web, json=None):
        """
         @Summary:接口-重命名课程结构
         @Description:云课堂老师端课程管理使用
         :param url:
         :param params:{
                         "courseStructureId":"", # 课程结构id
                         "courseStructureName":"", # 课程结构名称
                         "userId":"", # 用户id
                         "userName":"", # 用户名称
                         "validCode":""# 验证码：&signKey=123123(md5加密)
                         }
         :param headers:
         :param json: json=None
         :return: 200 OK
         """

        url = url + "/courseApi/v1/coursemanagement/coursestructurename"

        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def post_sort_course_structure(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:接口-课程结构排序
        @Description:云课堂老师端课程管理使用
        :param url:
        :param params:{
                        "userId":"",#用户Id
                        "userName":"",#用户姓名
                        "validCode":""#验证码&signKey=123123(md5加密)
                        }
        :param headers:
        :param json:object:{
                                "childStructureList":"",#子课程结构
                                "parentId":"",#父id
                                "showOrder":"",#排序字段
                                "structureId":"",#课程结构id
                                "structureName":""#课程结构名称
                                }
        :return:200 OK
        """
        url = url + "/courseApi/v1/coursemanagement/coursestructuresort"

        r = requests.post(url=url, params=params, headers=headers, json=json)

        return r

    @classmethod
    def get_coursr_teacher_team(cls, url: str, params=None, headers=headers_web):
        """
        @Summary:接口-查看教师团队
        @Description:接口-查看教师团队
        :param url:
        :param params:{
                        "courseId":"",# 课程id
                        "isStatistics":"",# 是否获取统计
                        "validCode":"",# 验证码&signKey=123123(md5加密)
                        "versionId":""# 版本id
                        }
        :param headers:
        :return:object:{
                        "avatarInnerUrl":"", # 头像内网地址
                        "avatarOuterUrl":"", # 头像外网地址
                        "avatarPath":"", # 头像路径
                        "collegeId":"", # 学院id
                        "collegeName":"", # 学院名称
                        "dataSource":"", # 数据来源 0：校内；1：校外
                        "isLeader":"", # 是否为课程负责人
                        "jobTitle":"", # 职称
                        "schoolName":"", # 学校名称
                        "teacherId":"", # 老师id
                        "teacherName":"", # 老师名称
                        "teacherNo":"", # 老师工号
                        "teacherProfile":"", # 教师简介
                        "teachingTeamId":"" # 老师教师团队id
                        }
        """
        url = url + "/courseApi/v1/coursemanagement/courseteachingteam"
        r = requests.get(url=url, headers=headers, params=params)

        return r

    @classmethod
    def post_add_teacher_team(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:接口-老师加入课程教师团队
        @Description:云课堂老师端课程管理使用
        :param url:
        :param params:validCode:验证码&signKey=123123(md5加密)
        :param headers:
        :param json:{
                        "courseId":"", # 课程id
                        "dataSource":"", # 教师数据来源 0：校内；1：校外
                        "jobTitle":"", # 职称
                        "operatorId":"", # 学院id
                        "operatorName":"", # 学院名称
                        "schoolName":"", # 校外用户所属学校
                        "teacherId":"", # 老师id
                        "teacherName":"", # 老师名称
                        "teacherNo":"", # 老师工号
                        "teacherProfile":"", # 教师简介
                        "teachingTeamId":"", # 教学团队id
                        "versionId":"" # 版本id

                        }
        :return:200 OK
        """

        url = url + "/courseApi/v1/coursemanagement/courseteachingteam"

        r = requests.post(url=url, headers=headers, params=params, json=json)

        return r

    @classmethod
    def post_del_teacher_team(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:接口-老师退出课程教师团队
        @Description:云课堂老师端课程管理使用
        :param url:
        :param params:{
                        "courseTeachingTeamId":"", # 课程教学团队Id
                        "userId":"", # 操作人Id
                        "userName":"", # 操作人名称
                        "validCode":"" # 验证码&signKey=123123(md5加密)
                        }
        :param headers:
        :param json:json=None
        :return:200 OK
        """

        url = url + "/courseApi/v1/coursemanagement/courseteachingteam/delete"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def post_rename_course_resources(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:重命名课程资源
        @Description:云课堂老师端课程管理使用
        :param url:
        :param params:{
                        "fileId":"",# 资源Id
                        "fileName":"",# 资源名称
                        "userId":"",# 用户Id
                        "validCode":"" # 验证码（&signKey=123123）
                        }
        :param headers:
        :param json:json=None
        :return:{
                    "fileName":"",#资源名称
                    "resourceDetailId":"", # 资源详情Id
                    "resourceType":"" # 资源类型 2:课堂测验
                    }
        """

        url = url + "/courseApi/v1/coursemanagement/filename"

        r = requests.post(url=url, headers=headers, params=params, json=json)

        return r

    @classmethod
    def get_update_course_old_data(cls, url: str, params=None, headers=headers_web):
        """
        @Summary:课程建设老数据更新
        @Description:课程建设使用，只需要使用一次
        :param url:
        :param params:validCode:验证码:&signKey=123123(md5加密)
        :param headers:
        :return:
        """

        url = url + "/courseApi/v1/coursemanagement/olddataupdate"

        r = requests.get(url=url, headers=headers, params=params)

        return r

    @classmethod
    def get_new_build_course(cls, url: str, params=None, headers=headers_web):
        """
        @Summary:接口-获取最新建设的课程
        @Description:四军大门户首页最新建课使用
        :param url:
        :param params:{
                        "displayNum":"", # 展示数量
                        "validCode":"" # &signKey=123123(md5加密)
                        }
        :param headers:
        :return:object:{
                        "collegeName":"", # 课程所属学院
                        "courseCompletion":"",# 课程完成度
                        "courseId":"", # 课程id
                        "courseLeaderName":"", # 课程负责人名称
                        "courseName":"" # 课程名称
                        }
        """

        url = url + "/courseApi/v1/coursemanagement/portal/courses"

        r = requests.get(url=url, headers=headers, params=params)

        return r

    @classmethod
    def get_teaching_course(cls, url: str, params=None, headers=headers_web):
        """
        @Summary:接口-获取在授课程数据
        @Description:四军大门户首页在授课程使用
        :param url:
        :param params:{
                        "displayNum":"", # 展示数量
                        "validCode":"" # &signKey=123123(md5加密)
                        }
        :param headers:
        :return:object:{
                        "collegeName":"", # 课程所属学院
                        "teacherNames":"",# 教师名称
                        "courseId":"", # 课程id
                        "groupNames":"", # 班级名称
                        "courseName":"" # 课程名称
                        }
        """

        url = url + "/courseApi/v1/coursemanagement/portal/teachingcourses"

        r = requests.get(url=url, headers=headers, params=params)

        return r

    @classmethod
    def get_course_college_teacher_detail(cls, url: str, params=None, headers=headers_web):
        """
        @Summary:接口-根据课表详情id获取课程的老师和学院
        @Description:四军大门户首页在授课程使用
        :param url:
        :param params: {
                        "detailIds":"", # 课表详情id(多个用逗号分割)
                        "validCode":"" # &signKey=123123(md5加密)
                        }
        :param headers:
        :return:object:{
                        "collegeName":"", # 学院名称
                        "teacherNames":"",# 授课教师名称
                        "detailId":"" # 课表详情id

                        }
        """
        url = url + "/courseApi/v1/coursemanagement/portal/tourcourses"
        r = requests.get(url=url, headers=headers, params=params)
        return r

    @classmethod
    def get_teacher_info_in_data(cls, url: str, params=None, headers=headers_web):
        """
        @Summary:按教师编号搜索库中职称
        @Description:authoritycontrolplatformapi课程建设-课程团队调用，根据传入的教师工号查询教师职称
        :param url:
        :param params:{
                        "teacherNoOrName":"", # 教师工号或姓名
                        "validCode":"" # &signKey=123123(md5加密)
                        }
        :param headers:
        :return:{
                        "avatarInnerUrl":"", # 头像内网地址
                        "avatarOuterUrl":"", # 头像外网地址
                        "avatarPath":"", # 头像路径
                        "collegeId":"", # 学院id
                        "collegeName":"", # 学院名称
                        "gender":"", # 性别（0：未知；1：男；2：女）
                        "jobTitle":"", # 职称
                        "jobTitleOptions":"", # 职称下拉列表数据
                        "mobile":"", # 手机号
                        "position":"", # 职务
                        "userId":"", # 用户id
                        "userName":"", # 用户姓名
                        "userNo":"" # 用户工号/学号
                        }

        """
        url = url + "/courseApi/v1/coursemanagement/teacherinfos"
        r = requests.get(url=url, headers=headers, params=params)
        return r

    @classmethod
    def post_multi_upload_resource_package(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:接口-批量上传资源到备课包
        @Description:云课堂老师端调用
        :param url:
        :param params:validCode:&signKey=123123
        :param headers:
        :param json:{
                        "courseResourceList":[     # 资源集合
                            "fileRealName":"", # 文件实际名
                            "fileSavedName":"", # 文件保存名
                            "fileSize":"", # 文件大小
                            "fileType":"", # 文件类型
                            "filepath":"", # 文件路径
                            "id":"", # UUID做标识
                            "innerServerIp":"", # 内网IP
                            "outerServerIp":"" # 外网IP
                        ],
                        "courseStructureId":"", # 课程结构id
                        "userId":"", # 用户id
                        "userName":"" # 用户名称
                        }
        :return:{
                    "fileRealName":"", # 文件实际名
                    "fileSavedName":"", # 文件保存名
                    "fileSize":"", # 文件大小
                    "fileType":"", # 文件类型
                    "filepath":"", # 文件路径
                    "id":"", # UUID做标识
                    "innerServerIp":"", # 内网IP
                    "outerServerIp":"" # 外网IP
                }
        """

        url = url + "/courseApi/v1/coursemanagement/uploadresourceList"

        r = requests.post(url=url, headers=headers, params=params, json=json)

        return r

    @classmethod
    def post_upload_resource(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:上传教学资源
        @Description:authoritycontrolplatformapi课程建设-课程团队调用，根据传入的教师工号查询教师职称
        :param url:
        :param params:validCode:&signKey=123123
        :param headers:
        :param json:{
                    "isPublic": "", # 是否为公共资源 true：公共资源 false：私有资源
                    "fileList": [{
                          "fileRealName": "", # 文件实际名
                          "fileSavedName": "", # 文件保存名
                          "fileSize": "", # 文件大小
                          "fileType": "", # 文件类型
                          "filepath": "", # 文件路径
                          "innerServerIp": "", # 内网IP
                          "outerServerIp": "" # 外网IP
                    }],
                    "resourceType":"", # 资源类型 0：教学课件 1：视频 2:测验 3:图片
                    "userName": "", # 用户姓名
                    "userId": "", # 用户Id
                    "courseStructureId": "" # 课程结构Id
        }
        :return: 200 OK
        """

        url = url + "/courseApi/v1/coursemanagement/uploadresources"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def get_teacher_yes_or_no_in_team(cls, url: str, params=None, headers=headers_web, paramspath=None):
        """
        @Summary:接口-判断该课程老师加入课程教师团队
        @Description:云课堂老师端课程管理使用
        :param url:
        :param params:{
                        "courseId:":"", # 课程id,swagger文档有误
                        "teacherId":"", # 老师id
                        "validCode":"" # courseId=?&signKey=123123(md5加密)
                        }
        :param headers:
        :param paramspath:courseId:课程id
        :return: boolean:status: # true-加入 false-未加入
        """

        url = url + f"/courseApi/v1/coursemanagement/{paramspath}/courseteachingteam"
        r = requests.get(url=url, headers=headers, params=params)
        return r

    @classmethod
    def get_query_material_module_info(cls, url: str, params=None, headers=headers_web, paramspath=None):
        """
        @Summary:接口-查询课程课程介绍、课程大纲、考核办法信息
        @Description:云课堂老师端课程管理使用
        :param url:
        :param params:{
                        "materialModuleType":"", # 资料模块类型：0 课程介绍，1课程大纲，2考核办法
                        "validCode":"", # courseId=?&signKey=123123(md5加密)
                        "versionId":"" # 版本id
                        }
        :param headers:
        :param paramspath:courseId:课程id
        :return:{
                  "courseContent": "", # 课程内容
                  "courseName": "", # 课程名称
                  "collegeName": "", # 学院名称
                  "courseCategoryId": "", # 课程类别id
                  "referenceMaterials": "", # 参考教材
                  "teachingMaterial": "", # 教材
                  "courseIntroductionList": [{ # 资源集合
                      "classificationName": "", # 分类内容
                      "classificationContent": "" # 分类名称
                    }],
                  "courseCategoryName": "", # 课程类别名称
                  "classHours": "", # 学时
                  "teachingUserType": "", # 授课对象
                  "collegeId": "", # 学院ID
                  "assessmentMethod": "" # 考核办法
                }
        """

        url = url + f"/courseApi/v1/coursemanagement/{paramspath}/materialmoduleinfo"

        r = requests.get(url=url, headers=headers, params=params)
        return r

    @classmethod
    def post_query_material_module_info(cls, url: str, params=None, headers=headers_web, paramspath=None, json=None):
        """
        @Summary:接口-维护课程课程介绍、课程大纲、考核办法信息
        @Description:云课堂老师端课程管理使用
        :param url:
        :param params:validCode:courseId=?&signKey=123123(md5加密)
        :param headers:
        :param paramspath:courseId:课程id
        :param json:{
                  "courseContent": "", # 课程内容
                  "courseName": "", # 课程名称
                  "userName": "", # 用户名称
                  "courseCategoryId": "", # 课程类别id
                  "referenceMaterials": "", # 参考教材
                  "teachingMaterial": "", # 教材
                  "courseIntroductionList": [{ # 资源集合
                      "classificationName": "", # 分类内容
                      "classificationContent": "" # 分类名称
                    }],
                  "materialContent": "", # 资料内容
                  "classHours": "", # 学时
                  "teachingUserType": "", # 授课对象
                  "materialType": "", # 资料模块类型：0 课程简介，1课程大纲，2考核办法
                  "userId": "", # 用户id
                  "versionId":"" # 版本id
                }
        :return:
        """
        url = url + f"/courseApi/v1/coursemanagement/{paramspath}/materialmoduleinfo"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def get_course_structure_is_del(cls, url: str, params=None, headers=headers_web, paramspath=None):
        """
        @Summary:接口-判断该课程结构是否删除
        @Description:云课堂老师端新增教学内容使用
        :param url:
        :param params:validCode:courseStructureId=?&signKey=123123(md5加密)
        :param headers:
        :param paramspath:courseStructureId:课程结构id
        :return:boolean
        """
        url = url + f"/courseApi/v1/coursemanagement/{paramspath}/isdelete"
        r = requests.get(url=url, headers=headers, params=params)
        return r

    @classmethod
    def post_move_course_resource(cls, url: str, params=None, headers=headers_web, paramspath=None, json=None):
        """
        @Summary:接口-课程资源移动
        @Description:云课堂老师端课程管理使用
        :param url:
        :param params:{
                        "courseResourceIds":"", # 资源Id,多个以‘，’分割
                        "userId":"", # 用户Id
                        "validCode":"" # courseStructureId=?&signKey=123123(md5加密)
                        }
        :param headers:
        :param paramspath:courseStructureId:课程结构Id
        :param json:json=None
        :return:200 ok
        """

        url = url + f"/courseApi/v1/coursemanagement/{paramspath}/moved"

        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def get_teacher_fuzzy_search_course_list(cls, url: str, params=None, headers=headers_web, paramspath=None):
        """
        @Summary:接口-课程资源移动
        @Description:云课堂老师端课程管理使用
        :param url:
        :param params:{
                        "courseNameOrCode":"", # 课程名称或编号
                        "validCode":"" # 验证码teacherId=?&signKey=123123(md5加密)
                        }
        :param headers:
        :param paramspath:teacherId:老师id
        :return:object:{
                  "collegeCode": "", # 学院编号
                  "collegeName": "", # 学院名称
                  "courseClassNum": "", # 课程班级数量 biginteger类型
                  "courseCode": "", # 课程编号
                  "courseId": "", # 课程Id
                  "courseLeaderId": "", # 课程负责人id
                  "courseLeaderName": "", # 课程负责人名称
                  "courseName": "", # 课程名称
                  "courseSource": "", # 课程来源 0：数据对接；1：课程管理新建
                  "operatorName": "" # 操作人
                }
        """

        url = url + f"/courseApi/v1/coursemanagement/{paramspath}/courseList"
        r = requests.get(url=url, headers=headers, params=params)
        return r

    @classmethod
    def get_teacher_view_join_course_list(cls, url: str, params=None, headers=headers_web, paramspath=None):
        """
        @Summary:接口-老师查看加入的课程
        @Description:云课堂老师端课程理使用
        :param url:
        :param params:validCode:验证码teacherId=?&signKey=123123(md5加密)
        :param headers:
        :param paramspath:teacherId:老师id
        :return:object:{
                  "completeRate": "", # 资料完成度
                  "courseCode": "", # 课程编号
                  "courseId": "", # 课程id
                  "courseName": "", # 课程名称
                  "courseSource": "", # 课程来源（0：数据对接；1：课程管理）
                  "courseTeachingTeamId": "", # 是否存在课程班级（true：存在；false：不存在）
                  "existCourseClass": "", # 课程负责人名称
                  "teacherType": "" # 老师类型：0 团队老师；1 课程负责人

                }
        """

        url = url + f"/courseApi/v1/coursemanagement/{paramspath}/courses"

        r = requests.get(url=url, headers=headers, params=params)

        return r

    @classmethod
    def get_teacher_view_join_course_info(cls, url: str, params=None, headers=headers_web, paramspath=None):
        """
        @Summary:接口-老师查看加入的课程信息
        @Description:云课堂老师端题库使用
        :param url:
        :param params:validCode:验证码teacherId=?&signKey=123123(md5加密)
        :param headers:
        :param paramspath:teacherId:老师id
        :return:object:{
                  "collegeCode": "", # 学院编号
                  "collegeName": "", # 学院名称
                  "courseClassNum": "", # 课程id
                  "courseCode": "", # 课程名称
                  "courseId": "", # 课程来源（0：数据对接；1：课程管理）
                  "courseLeaderId": "", # 是否存在课程班级（true：存在；false：不存在）
                  "courseLeaderName": "", # 课程负责人id
                  "courseName": "", # 课程负责人名称
                  "courseSource":"", # 操作人
                  "operatorName":"" #  操作人

                }
        """

        url = url + f"/courseApi/v1/coursemanagement/{paramspath}/joincourseList"

        r = requests.get(url=url, headers=headers, params=params)

        return r

    @classmethod
    def post_class_test_paper(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:创建课堂测验试卷
        @Description:1.云课堂老师端创建课堂测验试卷
        :param url:
        :param params:validCode:&signKey=123123(md5加密)
        :param headers:
        :param json：
        """

        url = url + f"/teachingApi/v1/coursemanagement/classtestpaper"

        r = requests.post(url=url, headers=headers, params=params, json=json)

        return r
